/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac4.conexion;

/**
 *
 * @author andres
 */
//import javax.swing.table.DefaultTableModel;
import edu.uoc.tdp.pac4.beans.Usuari;
import edu.uoc.tdp.pac4.beans.Taller;
import javax.swing.table.DefaultTableModel;

//import javax.swing.JTable;

public class ImmutableTable extends DefaultTableModel {
    private static final long serialVersionUID = 1L;        
    
    
    ImmutableTable(Object[] header, int cols){
        super(header, cols);
    }
    
    public void addUsuari(Usuari u) {
        //Object[] p = {"Melon", "Boqueron" };
        Object[] p = u.toTable();
        this.addRow(p);
        System.out.println("Añadiendo Usuario "+u.getUsuari());
    }
    
    
     public void addTaller(Taller t) {
        Object[] p = t.toTable();
        this.addRow(p);
        
    }
    
    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }
    
}
